﻿namespace Rezene.Web.Business.Amazon.Entities
{
    public class S3PhotoObject : S3BaseObject
    {
        public S3PhotoObject()
        {
                
        }

        public S3PhotoObject(S3BaseObject obj)
        {
            Name = obj.Name;
            Path = obj.Path;
            Bucket = obj.Bucket;                
        }        
        public string Description { get; set; }   
        
        public string DisplayName
        {
            get
            {
                return string.IsNullOrEmpty(Title) ? Name : Title;
            }
        } 
        
        public string GalleryPath
        {
            get
            {
                if(AmazonPath != "/" && AmazonPath.Contains("/"))
                {
                    return AmazonPath.Substring(0, AmazonPath.LastIndexOf("/"));
                }
                return string.Empty;
            }
        }
    }
}